﻿@using Microsoft.AspNetCore.Mvc.Localization
@using Reborn.IdentityServer4.Admin.UI.Configuration.Constants
@model Reborn.IdentityServer4.Admin.BusinessLogic.Identity.Dtos.Identity.Interfaces.IUserProvidersDto
@inject IViewLocalizer Localizer

@{
    ViewBag.Title = Localizer["PageTitle"];
    Layout = "_Layout";
}

<div class="row">

    <div class="col-12">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item">
                    <a asp-area="@CommonConsts.AdminUIArea" asp-controller="Identity" asp-action="Users">@Localizer["NavigationUsers"]</a>
                </li>
                <li class="breadcrumb-item">
                    <a asp-area="@CommonConsts.AdminUIArea" asp-controller="Identity" asp-action="UserProfile" asp-route-id="@Model.UserId">@Model.UserName</a>
                </li>
                <li class="breadcrumb-item active" aria-current="page">@Localizer["PageTitle"]</li>
            </ol>
        </nav>
    </div>

    <div class="col-md-12">
        <h3>@Localizer["PageTitle"]</h3>

        <div class="row table-responsive">
            <table class="table table-striped">
                <thead>
                <tr>
                    <th>@Localizer["TableLoginProvider"]</th>
                    <th>@Localizer["TableProviderDisplayName"]</th>
                    <th>@Localizer["TableProviderKey"]</th>
                    <th></th>
                </tr>
                </thead>
                <tbody>
                @foreach (var provider in Model.Providers)
                {
                    <tr>
                        <td>@provider.LoginProvider</td>
                        <td>@provider.ProviderDisplayName</td>
                        <td>@provider.ProviderKey</td>
                        <td>
                            <a asp-area="@CommonConsts.AdminUIArea" asp-action="UserProvidersDelete" asp-route-providerKey="@provider.ProviderKey" asp-route-id="@Model.UserId" class="btn btn-danger">@Localizer["TableButtonRemove"]</a>
                        </td>
                    </tr>
                }
                </tbody>
            </table>
        </div>
    </div>
</div>